/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$(document).ready(function(){
  $('#birthdate-dp').datepicker();
    
  request_bind('create_client', function(){
    $('#client-add').submit(function() { 
      $.post("ajax/create.jsp", $(this).serialize(), function(data){            
        var id = data.id;
        var name = data.firstName;
        redirectWithResult({
          id:id, 
          name:name
        });
      });
      return false;
    });
  });
   
  request_bind('', function(){
    $('#client-add').submit(function() { 
      $.post("ajax/create.jsp", $(this).serialize(), function(data){            
        resetForm('#client-add');
      });
      return false;
    });
  });
    
});
